<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
	<title>山西青职院-WPS考题管理系统</title>
	<script>
		function overtime() {
			location.href='../login.html';
		}
	</script>
	<script src="./../js/index.js"></script>
	<script src="./../ckeditor2/ckeditor.js"></script>
	<script type="text/javascript">
		$(document).ready(function(){
			$(document).bind("contextmenu",function(e){
				e.preventDefault();
				//return false;
			});
		});

		//获取登录用户信息
		$.ajax({
			url: '/getUserMsg',
			method: 'post',
			success: function (data) {
				if (data.code == 200) {
					$('#username20200612').html(data.data.name);
				} else {
					alert(data.message);
				}
			},
			error: function () {
				console.log("未知异常，请与管理员联系！");
			},
		});

		// function getUrlParam(name) {
		// 	let reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)"); //构造一个含有目标参数的正则表达式对象
		// 	let r = window.location.search.substr(1).match(reg);  //匹配目标参数
		// 	if (r != null) return unescape(r[2]); return null; //返回参数值
		// }


		$(function(){
			// let username = getUrlParam('username');
        	// $('#username20200612').html(username);

            $('#agency_affair_admin').tooltip({
                content: $('<div></div>'),
                showEvent: 'click',
               // position: 'left',
                onUpdate: function(content){
                    content.panel({
                        width: 360,
                        border: false,
                      //  title: 'Login',
                        href: 'agency_affair_admin.html',
                        footer:'#footer'
                    });
                },
                onShow: function(){
                    var t = $(this);
                    t.tooltip('tip').unbind().bind('mouseenter', function(){  //mouseenter
                        t.tooltip('show');
                    }).bind('mouseleave', function(){
                        t.tooltip('hide');
                    });
                }
            });

            $('#loginOut20200612').click(function () {
				$.messager.confirm('提示','确定要退出吗?',function(r){
					if (r){
						$.get("./../logout", function(data){
							location.href='../login.html';
						});
					}
				});
			});

        });

        function updatePassword() {

			let isValid = $('#updatePasswordForm').form('validate');
			if (!isValid){
				return;
			}

            let newPassword = $('#newPassword').val();
            let newPasswordConfirm = $('#newPasswordConfirm').val();

            if(newPassword != newPasswordConfirm){
				$.messager.alert('提示','两次输入的新密码不一致！');
                return
            }

            $.ajax({
                url:'/updatePassword',
                data: $('#updatePasswordForm').serialize(),
                method: 'post',
                success:function(data){
                    if(data.code == 200){
						new jBox('Notice', {
							color: 'green',
							autoClose: 2500,
							content: '修改成功。',
							showCountdown: true,
							animation: 'slide'
						});
                        $("input[type='password']").val('');
                        $('#dialog_20200606_loginUser').dialog('close')
                    }else{
						new jBox('Notice', {
							color: 'red',
							autoClose: 2500,
							content: data.message,
							showCountdown: true,
							animation: 'slide'
						});
                    }
                },
                error:function(){
                    console.log("未知异常，请与管理员联系！");
                },

            });
        }
	</script>
	<style>
		.nav-link {
			position: relative;
			margin-top: -8px;
			padding: 0 14px;
			line-height: 34px;
			font-size: 10px;
			font-weight: bold;
			color: #555;
			text-decoration: none;
			text-shadow: 0 1px white;
		}
		.nav-link:hover {
			color: #333;
			text-decoration: underline;
		}

		.nav-counter {
			position: absolute;
			top: -1px;
			right: 0px;
			min-width: 8px;
			height: 18px;
			line-height: 18px;
			margin-top: -15px;
			padding: 0 5px;
			font-weight: normal;
			color: white;
			text-align: center;
			text-shadow: 0 1px rgba(0, 0, 0, 0.2);
			background: #e23442;
			/*border: 1px solid #911f28;*/
			border-radius: 11px;
			background-image: -webkit-linear-gradient(top, #e8616c, #dd202f);
			background-image: -moz-linear-gradient(top, #e8616c, #dd202f);
			background-image: -o-linear-gradient(top, #e8616c, #dd202f);
			background-image: linear-gradient(to bottom, #e8616c, #dd202f);
			-webkit-box-shadow: inset 0 0 1px 1px rgba(255, 255, 255, 0.1), 0 1px rgba(0, 0, 0, 0.12);
			box-shadow: inset 0 0 1px 1px rgba(255, 255, 255, 0.1), 0 1px rgba(0, 0, 0, 0.12);
		}

		.nav-counter-green {
			background: #75a940;
			border: 1px solid #42582b;
			background-image: -webkit-linear-gradient(top, #8ec15b, #689739);
			background-image: -moz-linear-gradient(top, #8ec15b, #689739);
			background-image: -o-linear-gradient(top, #8ec15b, #689739);
			background-image: linear-gradient(to bottom, #8ec15b, #689739);
		}

		.nav-counter-blue {
			background: #3b8de2;
			border: 1px solid #215a96;
			background-image: -webkit-linear-gradient(top, #67a7e9, #2580df);
			background-image: -moz-linear-gradient(top, #67a7e9, #2580df);
			background-image: -o-linear-gradient(top, #67a7e9, #2580df);
			background-image: linear-gradient(to bottom, #67a7e9, #2580df);
		}


		.easyui-dot {
			position: relative;
			top: -1px;
			display: inline-block;
			width: 6px;
			height: 6px;
			vertical-align: middle;
			border-radius: 50%;
		}
		.easyui-status-processing {
			position: relative;
			background-color: #1890ff;
		}
		.easyui-status-success {
			 background-color: #52c41a;
		}
		.easyui-status-error {
			background-color: #f5222d;
		}
		.easyui-status-default {
			background-color: #d9d9d9;
		}

		.easyui-status-processing:after {
			position: absolute;
			top: 0;
			left: 0;
			width: 4px;
			height: 4px;
			border: 1px solid #1890ff;
			border-radius: 50%;
			animation: antStatusProcessing 1.2s ease-in-out infinite;
			content: "";
		}

		@keyframes antStatusProcessing {
			0% {
				transform: scale(0.8);
				opacity: 0.5;
			}
			to {
				transform: scale(2.4);
				opacity: 0;
			}
		}
	</style>
	<script>
		$(function(){
			$('#dialog_20200606_loginUser').dialog({
				width: 400,
				closed: true,
				modal: true,
				buttons:'#dialog_login_20200606'
			});
			$('#loginUploadNamePass').click(function(){
				$('#dialog_20200606_loginUser').dialog('open').dialog('center').dialog('setTitle','密码修改');
                $("input[type='password']").val('');
			});
		});
	</script>
</head>
<body>
	<div class="easyui-layout" data-options="fit:true">
        <div data-options="region:'west',border: false" style="width:256px; background: #001529;">
			<div style="height: 64px; line-height: 64px; color: white; text-align: center;font-size: 22px;">
				<img src="../image/cLogo.png" style="width:40px; height: 40px; margin-top: 10px;" />
					<label id="leftTitleshow" style="cursor: pointer;">WPS考题管理系统</label>
	        </div>
        	<div id="menu20181026wyj"></div>
        </div>
        <div data-options="region:'center',border: false">       
		    <div class="easyui-layout" data-options="fit:true">
				<div data-options="region:'north'" style="height:65px; line-height: 65px;" id="top_navigation">
					 <div style="float: left; height: 63px; width: 50px; text-align: center;">
				        <i class="fa fa-outdent" id="fa-outdent" style="font-size:20px;color: #7c7c7c;cursor: pointer;" onclick="toggle_collapse_expand()"></i>
				        <i class="fa fa-indent"  id="fa-indent"  style="font-size:20px;color: #7c7c7c;cursor: pointer;display: none;" onclick="toggle_collapse_expand()"></i>
				    </div>
					<div style="float: left; height: 63px; text-align: center;">

					</div>

					<div id="loginOut20200612" style="float: right; height: 63px; margin-right: 1px; width: 30px; text-align: center;cursor: pointer;">
						<i class="fa fa-sign-out"  style="font-size:20px;color: #bf463a;"></i>
					</div>

				    <div id="loginUploadNamePass" style="float: right; height: 63px; margin-right: 1px; width: 130px; text-align: center;cursor: pointer;">
				    	<i class="fa fa-user"  id="201905-3"  style="font-size:20px;color: blue;"></i>
						<label id="username20200612"></label>
					</div>



				</div>
				<div data-options="region:'center',border:false">
					<div class="easyui-layout" data-options="fit:true">
						<div data-options="region:'center'" style="background: #f0f2f5;">
							<div id="loadingMessageMain_panel">
								<div title="<i class='fa fa-tachometer' style='font-size:16px;color:green' aria-hidden='true'></i>首页" id="shouye20181231" data-options="href:'./welcome.html'"></div>
							</div>					
						</div>
					</div>
				</div>
			</div>
        </div>
    </div>
    
    <!-- 选项卡右击菜单 -->
	<div id="tabsMenu" class="easyui-menu">
		<div id="close">关闭</div>
		<div id="closeOther">除当前关闭全部</div>
		<div id="closeAll" data-options="iconCls:'icon-cancel'">关闭全部</div>
		<div class="menu-sep"></div>
		<div>
			<span>选项卡布局</span>
			<div style="width:80px;">
				<div id="top">默认(顶部)</div>
				<div class="menu-sep"></div>
				<div id="left">左对齐</div>
				<div id="right">右对齐</div>
				<div id="bottom">底部</div>
			</div>
		</div>
	</div>



	<div id="dialog_20200606_loginUser" style="padding:10px 30px;display: none;">
		<form id="updatePasswordForm" method="post" data-options="novalidate:true" >
			<div style="margin-bottom:20px">
				<input class="easyui-passwordbox" id="password" name="password"  style="width:100%" data-options="label:'登录密码:',required:true,validType:'length[6,18]'" autocomplete="off">
			</div>
			<div style="margin-bottom:20px">
				<input class="easyui-passwordbox" id="newPassword" name="newPassword"  style="width:100%" data-options="label:'新密码:',required:true,validType:'length[6,18]'" autocomplete="off">
			</div>
			<div style="margin-bottom:20px">
				<input class="easyui-passwordbox" id="newPasswordConfirm"  style="width:100%" data-options="label:'确认密码:',required:true,validType:'length[6,18]'" autocomplete="off">
			</div>
		</form>
	</div>
	<div id="dialog_login_20200606" style="display: none;">
		<a href="javascript:$('#dialog_20200606_loginUser').dialog('close')" class="easyui-linkbutton">放弃</a>
		<a href="javascript:" class="easyui-linkbutton" data-options="iconCls:'icon-ok'" onclick="updatePassword()">保存</a>
	</div>

</body>
</html>